package com.app.mapper;

import com.app.model.DisasterReportingModel;
import com.app.model.UserModel;
import com.app.vo.ValueAndNameVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DisasterReportingMapper extends BaseMapper<DisasterReportingModel> {

    @Select("select type as 'name',count(type)as 'value' from lm_disaster_reporting group by type")
    List<ValueAndNameVo> getDisasterTypeCount();

    @Select("select count(*) from lm_disaster_reporting where type=#{type} and occur_time like #{month}")
    Integer getTypeMonthCount(Integer type, String month);
    @Select("select openid from lm_openid")
    List<UserModel> whiteList();
}
